<!--
 * @Author: Dagon
 * @Date: 2021-03-06 20:59:33
 * @Description: css 画三角形
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    .box1 {
      width: 0;
      height: 0;
      border-top: 50px solid transparent;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-bottom: 50px solid red;
    }

    .box2 {
      margin-top: 100px;
      width: 100px;
      border-top: 100px solid red;
      border-right: 25px solid transparent;
    }
  </style>
  <title>Document</title>
</head>

<body>
  <div class="box1"></div>
  <div class="box2"></div>
</body>

</html>